<?php defined('BASEPATH') OR die('No direct access allowed.');
/**
 * Description of "Settings_model"
 *
 * Created on Jan 26, 2011
 * @author Ramon Gutierrez
 * @copyright Bitstop Network Services Inc.
 * @version 0.1
 */

class Settings_model extends Model {
	public function Settings_model() {
        parent::Model();
		$this->CI =& get_instance();
    }
	
	// Get site configuration
	public function getConfig($client_id = false) {
		$query = $this->db->query("SELECT name, value FROM settings WHERE client_id IS NULL" . ($client_id ? " OR client_id = $client_id" : ''));
		$return = array();
		
		foreach($query->result_array() as $row) {
			$return[$row['name']] = $row['value'];
		}
		
		return $return;
	}
}

/* End of file settings_model.php */
/* Location: ./system/application/models/settings_model.php */